package ym.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ym.pojo.*;
import ym.service.IChatAssistant;
import ym.vo.BaseResult;

/**
 * ai聊天
 */
@RestController
@RequestMapping("/base")
public class ChatController {
    @Autowired
    IChatAssistant iChatAssistant;

    /**
     * 聊天接口
     *
     * @param message
     * @return
     */
    @GetMapping("/chat")
    public BaseResult chat(String message) {
        String chat = iChatAssistant.chat(message);
        return BaseResult.ok(chat);
    }

    //患者的性别为：男，患者的年龄为：23，患者的身高为：180，患者的体重为：160，患者所患疾病为：低血糖
    /**
     * 患者NSR-2002评估接口
     *
     * @param message
     * @return
     */
    @GetMapping("/patientNRS")
    public BaseResult patientNRS(String message) {
        Patient patient = iChatAssistant.patientNRS(message);
        return BaseResult.ok(patient);
    }

    /**
     * 患者MUST评估接口
     *
     * @param message
     * @return
     */
    @GetMapping("/patientMUST")
    public BaseResult patientMUST(String message) {
        Patient patient = iChatAssistant.patientMUST(message);
        return BaseResult.ok(patient);
    }

    /**
     * 制定计划接口
     *
     * @param message
     * @return
     */
    @GetMapping("/patientNutritionPlan")
    public BaseResult patientNutritionPlan(String message) {
        NutritionPlan nutritionPlan = iChatAssistant.patientNutritionPlan(message);
        return BaseResult.ok(nutritionPlan);
    }

    /**
     * 膳食方案接口
     *
     * @param message
     * @return
     */
    @GetMapping("/patientMealPlan")
    public BaseResult patientMealPlan(String message) {
        MealPlan mealPlan = iChatAssistant.patientMealPlan(message);
        return BaseResult.ok(mealPlan);
    }

    /**
     * 肠内营养方案接口
     *
     * @param message
     * @return
     */
    @GetMapping("/patientEnteralNutritionPlan")
    public BaseResult patientEnteralNutritionPlan(String message) {
        EnteralNutritionPlan enteralNutritionPlan = iChatAssistant.patientEnteralNutritionPlan(message);
        return BaseResult.ok(enteralNutritionPlan);
    }

    /**
     * 肠外营养方案
     *
     * @param message
     * @return
     */
    @GetMapping("/patientParenteralNutritionPlan")
    public BaseResult patientParenteralNutritionPlan(String message) {
        ParenteralNutritionPlan parenteralNutritionPlan = iChatAssistant.patientParenteralNutritionPlan(message);
        return BaseResult.ok(parenteralNutritionPlan);
    }
}
